-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Optional[Hashable] in dict type hints #40534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for a while we had an alias |
that was removed in #39107, although looking back, I didn't do the follow-up And so I also missed the cases of Thanks @topper-123 generally lgtm. I don't think necessary to change the comments but nbd |
maybe in some cases helps readablity, we have |
There are many case for function/method parameters like this: def func_name(kw: Optional[Hashable] = None, kw_2) -> ...:
... In such cases the I don't have a very strong opinions, but somewhat prefer |
Thanks @topper-123 |
Minor clean-up.
In old versions of mypy, mypy had a bug and didn't see this, but is has been fixed now.
There are many instances of
Optional[Hashable]
instead of justHashable
in the code base, other than in these dicts. I've assumed those should be left as-is for readability and not because it's strictly needed.